/*
 * @Description: Stay hungry，Stay foolish
 * @Author: Huccct
 * @Date: 2023-05-17 20:10:16
 * @LastEditors: Huccct
 * @LastEditTime: 2023-05-21 13:57:55
 */
import type { App } from 'vue'
import SvgIcon from './SvgIcon/index.vue'
import Pagination from './Pagination/index.vue'
import VerifyCode from './VerifyCode/index.vue'
import Category from './Category/index.vue'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
console.log(SvgIcon)
console.log(Pagination)

const comGlobal = {
  DefSvgIcon: SvgIcon,
  DefPagination: Pagination,
  VerifyCode: VerifyCode,
  defCategory: Category,
}
console.log('v3注册全局components', comGlobal)
console.log('全局图标组件', ElementPlusIconsVue)
// console.log(Object.entries(comGlobal))

const install = function (app: App) {
  Object.entries(comGlobal).forEach(([key, value]) => {
    app.component(key, value)
  })

  /*引入所有图标组件*/
  for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }
}

export default install
